package com.ask.controller;

import com.ask.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Value("${lesson}")
    private String lesson;

    @Autowired
    private Environment environment;
    @PostMapping("/login")
    public String login(@RequestBody User user){
        System.out.println(user);
        return user.toString();
    }

    @GetMapping("/loginGet")
    public String loginbyGet(@RequestBody User user){
        System.out.println(user);
        return user.toString();
    }
}
